<?php

namespace Apps\Common\Models;

/**
 * 美容院标签信息Model
 * @author     chenxiaolin
 * @date        2016年1月19日
 * @version     2.0.0
 * @copyright   Copyright 2016 meelier.com
 */
class BeautyParlorTagInfo extends \PhalconPlus\Database\Model
{

    /**
     *
     * @var integer
     */
    public $tag_id;

    /**
     *
     * @var string
     */
    public $tag_title;

    /**
     *
     * @var integer
     */
    public $tag_state;

    /**
     *
     * @var string
     */
    public $tag_addtime;
    /**
     * 
     * @var integer
     */
    public $parent_id;

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->hasMany('tag_id', 'Apps\Common\Models\BeautyParlorTag', 'tag_id', array('alias' => 'BeautyParlorTag'));
    }

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'beauty_parlor_tag_info';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return BeautyParlorTagInfo[]
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return BeautyParlorTagInfo
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

    /**
     * Independent Column Mapping.
     * Keys are the real names in the table and the values their names in the application
     *
     * @return array
     */
    public function columnMap()
    {
        return array(
            'tag_id' => 'tag_id',
            'tag_title' => 'tag_title',
            'tag_state' => 'tag_state',
            'tag_addtime' => 'tag_addtime',
        	'parent_id' => 'parent_id'
        );
    }

    public function defaultColumns()
    {
        return [
            'tag_state',
            'tag_addtime',
        ];
    }

}
